package udp.client.test; 

import udp.client.test.R;

import android.app.Activity; 
import android.os.Bundle; 
import android.view.KeyEvent;

public class UDPClient extends Activity { 
	public Client client;
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle icicle) { 
        super.onCreate(icicle); 
        setContentView(R.layout.main); 
        
        /* Kickoff the Server, it will 
         * be 'listening' for one client packet */ 
        client=new Client();
        new Thread(client).start();
    } 
    public boolean onKeyDown(int keyCode, KeyEvent event) { 
        
	     switch (keyCode) { 
	     case KeyEvent.KEYCODE_MENU: 
	          
	        	  finish();
	        	  client.clientSocket.close();
	        	  
	     }
	     return true;
	}
}